/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.ufc.quixada.adrs.dao;

import br.ufc.quixada.adrs.dao.config.PostGresMapConfig;
import br.ufc.quixada.adrs.model.Doenca;
import java.sql.SQLException;
import java.util.List;

/**
 *
 * @author Balthazar
 */
public class DoencaDAO {

    public void insert(Doenca doenca) throws SQLException{
        PostGresMapConfig.getSqlMapClient().insert("addDoenca", doenca);
    }

    public void deleteByQuestionarioSanitarioId(Long sanitarioId) throws SQLException{
        PostGresMapConfig.getSqlMapClient().delete("deleteDoencasBySanitario",sanitarioId);
    }

    public List<Doenca> getByQuestionarioSanitarioId(Long id) throws SQLException{
        return PostGresMapConfig.getSqlMapClient().queryForList("getDoencasByQuestionarioSanitarioId", id);
    }

}
